package cn.yusei.teamTribe.entity.school;

public abstract class AbstractSchool implements School{

	protected static String academy[];
	
	protected static String major[];
	
	@Override
	public int getAcademyValue(String academyName) {
		for(int i=1; i<academy.length; i++)
		{
			if(academy[i].equals(academyName))
				return i;
		}
		return 0;
	}
	
	@Override
	public String getAcademyName(int academyValue) {
		if(academyValue < academy.length)
			return academy[academyValue];
		return null;
	}
	
	@Override
	public int getMajorValue(String majorName) {
		for(int i=1; i<major.length; i++)
		{
			if(major[i].equals(majorName))
				return i;
		}
		return 0;
	}

	@Override
	public String getMajorName(int majorValue) {
		if(majorValue < major.length)
			return major[majorValue];
		return null;
	}
}
